package com.softeem.music_sys.controller;

import com.softeem.music_sys.entity.Admin;
import com.softeem.music_sys.mapper.AdminMapper;
import com.softeem.music_sys.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//对外提供访问接口
@RestController
public class AdminController {
    @Autowired
    private AdminService adminService;
    //管理员新增
    @RequestMapping("/admin/add")
    public boolean add(String username, String password) {
        Admin admin = new Admin();
        admin.setUsername(username);
        admin.setPassword(password);
        //执行插入
        //int i = adminMapper.insert(admin);
        //至少有一行数据受影响
        //return i > 0;
        return adminService.add(admin);
    }

    //管理员密码修改

    //管理员登录
    public boolean login(String username, String password) {
        //根据账号查询管理员信息


        //对比密码是否正确


        //判断账号是否禁用

        return false;

    }
    //
}
